]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupMenu: Make destroy() a bit more robust
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 14 Feb 2014 23:32:45 +0000 (00:32 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 18 Feb 2014 20:27:24 +0000 (21:27 +0100)
Currently destroying a menu's actor and calling its destroy() method
are subtly different - the latter will also result in the menu being
removed from the corresponding menu manager.
There is no good justification for that behavior, so make both actions
behave the same.

https://bugzilla.gnome.org/show_bug.cgi?id=724690

js/ui/popupMenu.js

index 39b6a2ae18640045a8ef7f35a1985f56d3417b2a..bec38a03e61f645c7dfb1d17d0e06ccf1298721f 100644 (file)
@@ -111,6 +111,7 @@ const PopupBaseMenuItem = new Lang.Class({
 
         this.actor.connect('key-focus-in', Lang.bind(this, this._onKeyFocusIn));
         this.actor.connect('key-focus-out', Lang.bind(this, this._onKeyFocusOut));
+        this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
     },
 
     _getTopMenu: function() {
@@ -192,6 +193,9 @@ const PopupBaseMenuItem = new Lang.Class({
 
     destroy: function() {
         this.actor.destroy();
+    },
+
+    _onDestroy: function() {
         this.emit('destroy');
     },